Class Amigo

java.lang.Object
  extended byAmigo
All Implemented Interfaces:
RARobotInterface, java.io.Serializable
Direct Known Subclasses:
AmigoImpl

public abstract class Amigo
extends java.lang.Object
implements java.io.Serializable, RARobotInterface

The class that interacts with the physical Amigo. This class will load a library on which it can perform some basic operations for controlling a robot. Implement the getCameraValue method in a subclass to get a fully functional robot! [BTN][SdJ]

See Also:
Serialized Form

Constructor Summary
Amigo()
          Default constructor.
 
Method Summary
 void connect()
          Connect the robot.
 void disconnect()
          Disconnect the robot.
abstract  RADataType getCameraValue()
          Implement this method for camera operation to work.
 java.lang.String[] getSensorIDs()
          Return the sensor id's in use by the robot.
 RADataType getSensorValue(java.lang.String sensor_id)
          Return the sensor value of the sensor indicated with the id specified.
 void initRobot()
          The init methods are used to create the robot on the server.
 void initRobot(int maxSpeed)
          The init methods are used to create the robot on the server.
 void robotGo(double speed, double angle)
          Command the robot to go somewhere!
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Amigo

public Amigo()
Default constructor.

Method Detail

initRobot

public final void initRobot()
The init methods are used to create the robot on the server. The Aria object will then be made and a pointer holds the object's place in the stack.


initRobot

public final void initRobot(int maxSpeed)
The init methods are used to create the robot on the server. The Aria object will then be made and a pointer holds the object's place in the stack.


connect

public final void connect()
Connect the robot.

Specified by:
connect in interface RARobotInterface

disconnect

public final void disconnect()
Disconnect the robot.

Specified by:
disconnect in interface RARobotInterface

robotGo

public final void robotGo(double speed,
                          double angle)
Command the robot to go somewhere! Speed must vary between 0 and 1 for no movement and full ahead resp. Angle between -1 and +1 for -180 and +180 resp. Other values will cause serious errors.

Specified by:
robotGo in interface RARobotInterface

getSensorIDs

public final java.lang.String[] getSensorIDs()
Return the sensor id's in use by the robot.

Specified by:
getSensorIDs in interface RARobotInterface

getSensorValue

public final RADataType getSensorValue(java.lang.String sensor_id)
                                throws RAException
Return the sensor value of the sensor indicated with the id specified.

Specified by:
getSensorValue in interface RARobotInterface
Throws:
RAException

getCameraValue

public abstract RADataType getCameraValue()
                                   throws RAException
Implement this method for camera operation to work.

Throws:
RAException